package com.hb.trade.client.project;

import cn.hutool.json.JSONObject;
import com.hb.core.pojo.parent.PageResult;
import com.hb.core.pojo.project.order.dto.UserOrderDTO;
import com.hb.core.pojo.project.order.dto.UserOrderGoodsDTO;
import com.hb.core.pojo.project.order.entity.UserOrder;
import com.hb.core.pojo.project.order.vo.UserOrderExportListVO;
import com.hb.core.pojo.project.order.vo.UserOrderListVO;
import com.hb.core.pojo.project.section.dto.BidSectionDTO;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

/**
 * describe:
 * 订单信息和下载文件
 *
 * @author zhongdl
 * @date 2021/12/22
 */
@FeignClient("hb-project")
public interface UserOrderClient {

    /**
     * @param userOrder:
     * @Description: 分页查询投标人购买文件列表
     * @Author: zhongdl
     * @Date:2021/12/22 11:12
     * @return: {@link Message< PageResult<   UserOrderDTO  >> }
     **/
    @PostMapping("/userOrder/pagePurchaseFile")
    Message<PageResult<UserOrderDTO>> pagePurchaseFile(@RequestBody UserOrderDTO userOrder);

    /**
     * @param userOrder:
     * @Description: 投标人购买文件列表
     * @author: zhongdl
     * @update zhaojk
     * @Date:2021/12/22 16:37
     * @return: {@link Message< UserOrderGoodsDTO> }
     **/
    @PostMapping("/userOrder/purchaseFile")
    Message<?> purchaseFile(UserOrderDTO userOrder);

    /**
     * @param goodsDTO:
     * @Description: 获取指定费用类型的收费情况
     * @Author: zhongdl
     * @Date:2022/2/21 18:58
     * @return: {@link Message< UserOrderGoodsDTO> }
     **/
    @PostMapping("/userOrder/feeInfo")
    Message<JSONObject> feeInfo(@RequestBody UserOrderGoodsDTO goodsDTO);

    /**
     * @Description: 跳转第三方支付, 创建订单
     * @Author: zhaojk
     * @Date:2022/2/21 18:58
     * @return: {@link Message< UserOrderGoodsDTO> }
     **/
    @PostMapping("/userOrder/createOrder")
    Message<UserOrderDTO> createOrder(UserOrderDTO userOrderDTO);

    /**
     * 费用管理列表
     *
     * @param sectionDTO
     * @return
     */
    @PostMapping("/userOrder/feeManagers")
    Message<?> feeManagers(BidSectionDTO sectionDTO);

    /**
     * 修改订单状态
     *
     * @param orderDTO
     * @return
     */
    @PostMapping("/userOrder/updateOrderStatus")
    Message<UserOrderDTO> updateOrderStatus(UserOrderDTO orderDTO);

    /**
     * 费用管理统计列表
     *
     * @param sectionDTO
     * @return
     */
    @PostMapping("/userOrder/fee/statistics")
    Message<?> feeStatistics(BidSectionDTO sectionDTO);

    /**
     * 查询订单详情
     * 带着商品列表信息
     *
     * @param orderDTO
     * @return
     */
    @PostMapping("/userOrder/orderDetail")
    Message<UserOrderDTO> orderDetail(UserOrderDTO orderDTO);

    /**
     * 查询订单列表
     *
     * @param goodsDTO
     * @return
     */
    @PostMapping("/userOrder/pageRecord")
    Message<?> pageRecord(UserOrderGoodsDTO goodsDTO);

    /**
     * 递交投标保证金和履约保证金
     *
     * @param order
     * @return
     */
    @PostMapping("/userOrder/saveBondInfo")
    Message<?> saveBondInfo(UserOrderDTO order);

    /**
     * 获取指定标段下的费用
     *
     * @param sectionId 标段ID
     * @param feeType   费用类型
     * @return
     */
    @PostMapping("/userOrder/getPrice")
    Message<BigDecimal> getPrice(@RequestParam Long sectionId, @RequestParam Integer feeType);

    /**
     * 查询指定投标人企业下的费用缴纳状态
     *
     * @param userOrderGoodsDTO#sectionId
     * @param userOrderGoodsDTO#feeType
     * @param userOrderGoodsDTO#userOrderDTO#orderStatus 订单状态
     * @return
     */
    @PostMapping("/userOrder/queryUserOrder")
    Message<UserOrder> queryUserOrder(UserOrderGoodsDTO userOrderGoodsDTO);

    /**
     * 获取指定的订单信息
     *
     * @param idOrOrderNo 主键ID或者订单号
     * @return
     * @author zhaojk
     */
    @PostMapping("/userOrder/getOrder")
    Message<UserOrder> getOrder(@RequestParam("primaryKey") String idOrOrderNo);

    /**
     *
     * @Description: 根据费用类型查询订单列表
     * @Author: zhongdl
     * @Date:2022/3/1 13:27
     * @param goodsDTO:
     * @return: {@link Message< List< UserOrderDTO>> }
     **/
    @PostMapping("/userOrder/listUserOrderByFreeType")
    Message<List<UserOrderDTO>> listUserOrderByFreeType(@RequestBody UserOrderGoodsDTO goodsDTO);

    /**
     * 已支付订单分页列表
     *
     * @author yuezheng
     * @param userOrderDTO
     * @return Message<PageResult < UserOrderListVO>>
     * @date 2022/4/13 11:37 PM
     */
    @PostMapping("/userOrder/listSuccess")
    Message<PageResult<UserOrderListVO>> listSuccessUserOrder(@RequestBody UserOrderDTO userOrderDTO);

    /**
     * 统计本月成交额
     *
     * @author yuezheng
     * @param
     * @return java.math.BigDecimal
     * @date 2022/4/14 10:07 AM
     */
    @PostMapping("/userOrder/count/amount")
    Message<BigDecimal> selectOrderAmountCountToMonth(@RequestBody UserOrderDTO userOrderDTO);

    /**
     * 统计本月成数
     *
     * @author yuezheng
     * @param
     * @return java.math.BigDecimal
     * @date 2022/4/14 10:07 AM
     */
    @PostMapping("/userOrder/count")
    Message<Integer> selectOrderCountToMonth(@RequestBody UserOrderDTO userOrderDTO);


    /**
     * 查询导出数据
     *
     * @author yuezheng
     * @param userOrderDTO
     * @return org.fzzn.core.model.msg.Message
     * @date 2022/4/14 4:22 PM
     */
    @PostMapping("/userOrder/export")
    Message<List<UserOrderExportListVO>> selectExportExcelList(@RequestBody UserOrderDTO userOrderDTO);

    @PostMapping("/userOrder/OrderPayStatus")
    public Message<Boolean> OrderPayStatus(@RequestBody UserOrderDTO userOrderDTO);
}
